/**
 * wangEditor的封装
 */
(function () {

    var WEditor = function (id) {
        this.id = id;
        this.uploadImgServer = Feng.ctxPath + '/file/uploadByEditor';
        this.uploadImgMaxLength = 10;
        this.uploadFileName = "file";
        this.editor;
    };

    WEditor.prototype = {
        create : function () {
            var E = window.wangEditor;
            var editor = new E('#contentEditor');
            editor.customConfig.uploadImgServer = this.uploadImgServer;
            editor.customConfig.uploadImgMaxLength = this.uploadImgMaxLength;
            editor.customConfig.uploadFileName = this.uploadFileName;
            editor.create();
            this.editor=editor;
        },
        getText:function(){
            return this.editor.txt.html()
        },
        setText:function(text){
            this.editor.txt.html(text);
        },
        disabled:function(){
            this.editor.$textElem.attr('contenteditable', false);
        }
    };


    window.WEditor = WEditor;

}());